package com.ky.serialport.bean;

/**
 *串口数据
 */
public class ComBean {

		public byte[] recData= null;  // 数据包
		public Long recTime = 0L;    // 获取时刻
		public String recComPort=""; // 串口号

		public ComBean(String sPort, byte[] buffer, int size){
			recComPort=sPort;
			recData = new byte[size];
			System.arraycopy(buffer, 0, recData, 0, size);  //arraycopy(源数组, 原数组的起始位置, 目标数组, 目标数组的起始位置, 要复制的元素数目);
			recTime = System.currentTimeMillis();
//			SimpleDateFormat sDateFormat = new SimpleDateFormat("hh:mm:ss");
//			recTime = sDateFormat.format(new java.util.Date());
		}
}